   var  currentPage=1;
   var currentPage2=1;
   var ids=getvl("ids");
/* 	  //  alert(goodsname);
	   	    window.location.href="1.4.1seach_goods.html?goodsname="+goodsname;*/
	   	    
	$(function(){
		if(ids==1){
			var pingpai='<input type="text" id="goodsname" value="搜索店铺或商品">'+
                '<input type="button" onclick="pingpai()" value="搜索">';
			$("#idss").append(pingpai);
		}
	});
	   	    
	function  pingpai(){
		//$("#chanping").html("");
	     	var goodsname=$("#goodsname").val();
		//$("#chanping").html("");
	    $.ajax({
        url:urlcore+"/api/brand/selectSearch?current="+currentPage2+"&goodsname="+goodsname,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					//alert(JSON.stringify(data.data.list))
					if(data.data!=null){
						$.each(data.data.list,function(y,n){
			 var chanping='<div class="public_goods">'+
'		<a href="6.0.0dianpu.html?id='+n.shop_id+'">'+
'			<dl>'+
'				<dt>'+
'					<img  onerror="errorImg(this)" src="'+n.brand_img+'" />'+
'				</dt>'+
'				<dd>'+
'					<h5>'+n.brand_name+'</h5>'+
'				</dd>'+
'			</dl>'+
'		</a>'+
'	</div>';
                $("#chanping").append(chanping);
           	});
					}else{
						alert("到底啦、、、");
					}
				}
			},
			error: function() {
				alert("error");
			}
		});
	}
	   	    var ss=0;
	function  shousuo2(){
		  if(currentPage==1 || currentPage==2 || ss!=0){
		var goodsname=$("#goodsname").val();
	    $.ajax({
        url:urlcore+"/api/goods/search?current="+currentPage+"&goodsname="+goodsname+"&types=1",
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					ss=data.data.list.length;
						$.each(data.data.list,function(y,n){
				var chanping='<div class="public_goods">'+
'		<a href="7.0.0goods_detail.html?id='+n.Goods_id+'">'+
'			<dl>'+
'				<dt>'+
'					<img  onerror="errorImg(this)" src="'+n.Goods_coverUrl+'" />'+
'				</dt>'+
'				<dd>'+
'					<h5>'+n.Goods_goodsTitle+'</h5>'+
'					<h6>&yen;'+n.Goods_packPrice+'</h6>'+
'				</dd>'+
'			</dl>'+
'		</a>'+
'	</div>';
              $("#chanping").append(chanping);
					});
					}
			},
			error: function() {
				alert("error");
			}
		});
		  }
	
	}

